obj-m += exploit.o

all:
	gcc -nostartfiles -nostdlib -o payload.elf start.S payload.c
	objcopy -O binary -j .text -j .rodata payload.elf payload.bin
	xxd -i payload.bin > payload.h
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
	rm payload.bin
	rm payload.elf
	rm payload.h
